package com.serviceImpl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.bean.FoodMaterial;
import com.mapper.FoodMaterialMapper;
import com.service.FoodMaterialService;

/**
 * @author  author : 张鹏
 * @date createTime：2018年1月17日 下午1:54:44 
 * @Description: 该类的功能描述
 */
@Service
public class FoodMaterialServiceImpl implements FoodMaterialService {
	@Resource
	FoodMaterialMapper foodMaterialMapper;


	@Override
	public List<FoodMaterial> getFoodMaterialByFoodId(int foodId) {
		// TODO Auto-generated method stub
		return foodMaterialMapper.selectByFoodId(foodId);
	}

	@Override
	public int editFoodMaterialByPrimaryKey(FoodMaterial foodMaterial) {
		// TODO Auto-generated method stub
		return foodMaterialMapper.updateByPrimaryKey(foodMaterial);
	}

	@Override
	public int insertFoodMaterial(FoodMaterial foodMaterial) {
		// TODO Auto-generated method stub
		return foodMaterialMapper.insert(foodMaterial);
	}

	@Override
	public int deleteByFoodId(int foodId) {
		// TODO Auto-generated method stub
		return foodMaterialMapper.deleteByFoodId(foodId);
	}
	
	

}
